﻿using GalaSoft.MvvmLight.Ioc;
using Microsoft.Practices.ServiceLocation;

namespace Mutzl.Samples.MapApp.ViewModel
{
    public class ViewModelLocator
    {
        public ViewModelLocator()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
            
            SimpleIoc.Default.Register<MapViewModel>();
            SimpleIoc.Default.Register<DetailViewModel>();
            SimpleIoc.Default.Register<SettingsViewModel>();
            
        }

        public MapViewModel Map { get { return SimpleIoc.Default.GetInstance<MapViewModel>(); } }

        public DetailViewModel Detail { get { return SimpleIoc.Default.GetInstance<DetailViewModel>(); } }

        public SettingsViewModel Settings { get { return SimpleIoc.Default.GetInstance<SettingsViewModel>(); } }


    }
}
